Page({
  data: {
    userInfo: {},
  },
  goLogin() {
    wx.navigateTo({
      url: '/pages/login/index',
    })
  },
  onShow() {
    this.getUserInfo()
  },
  // 获取用户信息
  async getUserInfo() {
    // const app = getApp()
    const res = await wx.http({
      url: '/userInfo',
      // header: { Authorization: `Bearer ${app.token}` },
    })
    this.setData({
      userInfo: res.data,
    })
  },
})
